/**
 * 商品相关API
 */

import request from './index.js'

// 商品相关API
export const productApi = {
  // 获取商品列表
  getProductList(params) {
    return request.get('/goods/list', params)
  },
  
  // 获取商品详情
  getProductDetail(id) {
    return request.get(`/goods/detail?goodsId=${id}`)
  },
  
  // 搜索商品
  searchProducts(params) {
    return request.get('/api/v1/sales/product/search', params)
  },
  
  // 获取商品分类
  getProductCategories() {
    return request.get('/api/v1/sales/product/category')
  },
  
  // 获取商品详情HTML
  getItemHtml(id) {
    return request.get(`/api/v1/sales/product/item.html/${id}`)
  }
}

export default productApi 